<?php
class Application_Form_Object extends Zend_Form
{
	public function __construct($options = null)
    {
        parent::__construct($options);
		$this->setName('object');
		$this->setMethod("post");
		$this->setEnctype("multipart/form-data");
	
			
		$name = new Zend_Form_Element_Text('name');
		$name->setLabel('Name:');
		$name->setRequired(true);
		$name->setFilters(array('StringTrim','StripTags'));
		$name->setValidators(array('NotEmpty'));
		
		$description = new Zend_Form_Element_Textarea('description');
		$description->setLabel('Description:');
		$description->addFilter('StripTags');
		$description->setAttrib('rows', 3);
		
		$image = new Zend_Form_Element_File('image');
		$image->setLabel('Upload Image:');
		$image->setDestination(PUBLIC_PATH.'/img/object/');
		$image->setRequired(true);
		//$image->setMultiFile(3);
		$image->addValidator('Count', false, 3);
		$image->addValidator('Size', false, 3145728);
		$image->addValidator('Extension', false, 'jpg,jpeg,png,gif');
	
		
	
		$elements = array($name, $description, $image);
		$this->addElements($elements);
	
		//$this->setDecorators( array('Composite'));
	}
}